﻿using Md.Api.Entity.DapperModels.MdDB;
using Md.Api.Model.Manage.MdNavigation.Request;
using Md.Dapper.Repositories.Md;

namespace Md.Api.Service.Manage.MdNavigation;
/// <summary>
/// 获取网站导航列表服务
/// </summary>
public class GetMdNavigationListService : ApiBase<RequestGetMdNavigationListModel>
{
    /// <summary>
    /// 网站导航仓储
    /// </summary>
    public MdNavigationRep mdNavigationRep { get; set; }
    /// <summary>
    /// 执行
    /// </summary>
    protected override void ExecuteMethod()
    {
        var model = new MdNavigationModel();

        model.Name = Parameter.Name;
        model.IsExternalLink = Parameter.IsExternalLink;
        model.Status = Parameter.Status;
        model.CreateBy = Parameter.CreateBy;
        model.UpdateBy = Parameter.UpdateBy;

        var res = mdNavigationRep.GetMdNavigationList(model, Parameter.OrderBy, Parameter.IsDesc);

        Result.Data = res;
    }
}

